<template>
  <a-tabs v-model="tabIndex" default-active-key="1" @change="callback">
    <a-tab-pane key="1" tab="待检测">
      <List1 ref=list1Id />
    </a-tab-pane>
    <a-tab-pane key="2" tab="已检测" force-render>
      <List2 ref=list2Id />
    </a-tab-pane>
  </a-tabs>
</template>

<script>
import List1 from './list1'
import List2 from './list2'
export default {
  name: 'interview',
  components: { List1, List2 },
  data() {
    return {
      tabIndex: "1"
    }
  },
  watch: {
    $route(data) {   //data为当前路由信息
      // console.log("route2:")
      // console.log(data)
      // this.getRouter(data.name)
      this.tabIndex = "1"
    }
  },
  methods: {
    callback(key) {
      if (key == '1') {
        this.$refs.list1Id.onQuery()
      } else {
        this.$refs.list2Id.onQuery()
      }
      console.log(key);
    },
  }
}
</script>

<style lang="less" scoped>
// .page-menu-tabs {
//   background-color: #fff;
//   padding: 0 24px;
// }

// .search-content {
//   margin-top: 0;
// }
/deep/.ant-tabs-bar {
  background-color: #fff;
}
</style>